package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.ElementBusiSrtpOtherMapper;
import com.ruoyi.net.domain.ElementBusiSrtpOther;
import com.ruoyi.net.service.IElementBusiSrtpOtherService;

/**
 * 网元-业务-srtp-其他属性Service业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class ElementBusiSrtpOtherServiceImpl implements IElementBusiSrtpOtherService 
{
    @Autowired
    private ElementBusiSrtpOtherMapper elementBusiSrtpOtherMapper;

    /**
     * 查询网元-业务-srtp-其他属性
     * 
     * @param id 网元-业务-srtp-其他属性主键
     * @return 网元-业务-srtp-其他属性
     */
    @Override
    public ElementBusiSrtpOther selectElementBusiSrtpOtherById(String id)
    {
        return elementBusiSrtpOtherMapper.selectElementBusiSrtpOtherById(id);
    }

    /**
     * 查询网元-业务-srtp-其他属性列表
     * 
     * @param elementBusiSrtpOther 网元-业务-srtp-其他属性
     * @return 网元-业务-srtp-其他属性
     */
    @Override
    public List<ElementBusiSrtpOther> selectElementBusiSrtpOtherList(ElementBusiSrtpOther elementBusiSrtpOther)
    {
        return elementBusiSrtpOtherMapper.selectElementBusiSrtpOtherList(elementBusiSrtpOther);
    }

    /**
     * 新增网元-业务-srtp-其他属性
     * 
     * @param elementBusiSrtpOther 网元-业务-srtp-其他属性
     * @return 结果
     */
    @Override
    public int insertElementBusiSrtpOther(ElementBusiSrtpOther elementBusiSrtpOther)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiSrtpOther.getId())) {
            elementBusiSrtpOther.setId(uuid);
        }
        elementBusiSrtpOther.setCreateBy(SecurityUtils.getUsername());
        elementBusiSrtpOther.setCreateTime(DateUtils.getNowDate());
        elementBusiSrtpOther.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpOther.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpOtherMapper.insertElementBusiSrtpOther(elementBusiSrtpOther);
    }

    /**
     * 修改网元-业务-srtp-其他属性
     * 
     * @param elementBusiSrtpOther 网元-业务-srtp-其他属性
     * @return 结果
     */
    @Override
    public int updateElementBusiSrtpOther(ElementBusiSrtpOther elementBusiSrtpOther)
    {
        elementBusiSrtpOther.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpOther.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpOtherMapper.updateElementBusiSrtpOther(elementBusiSrtpOther);
    }

    /**
     * 批量删除网元-业务-srtp-其他属性
     * 
     * @param ids 需要删除的网元-业务-srtp-其他属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpOtherByIds(String[] ids)
    {
        return elementBusiSrtpOtherMapper.deleteElementBusiSrtpOtherByIds(ids);
    }

    /**
     * 删除网元-业务-srtp-其他属性信息
     * 
     * @param id 网元-业务-srtp-其他属性主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpOtherById(String id)
    {
        return elementBusiSrtpOtherMapper.deleteElementBusiSrtpOtherById(id);
    }
}
